package ls.jpa.chapter3.dao;

import ls.jpa.chapter3.entity.UserInfo;
import org.springframework.stereotype.Repository;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.Transactional;

/**
 * @author Barudisshu
 */
@Repository
public class UserDao {

    @PersistenceContext
    private EntityManager em;

    @Transactional
    public UserInfo save(UserInfo userInfo){
        em.persist(userInfo);
        return userInfo;
    }
}
